import java.util.ArrayList;
import java.util.List;


public class Lista extends ArrayList implements List{
        
    public boolean esOperacion;
    public boolean n; 
    public boolean Op;
    
    public Lista(){
        super();
    }
    
    public Lista(Atomo ingreso){
        super();
        this.add(ingreso);
        }
    
    public Lista(List lista){
        super();
        if(lista ==null){
          lista = new Lista();
    }
    int e = 0;
    while (e < lista.size()){
	this.add(lista.get(e));
	e++;
		}
    }
    public void Agregar(Atomo ing){
        this.add(ing);
    }
    public boolean empty(){
        return this.size()==0;
    }
    public boolean existencia(Atomo ing){
        int a=0;
        while (a <= this.size() -1){
            if (this.get(a).equals(ing))
            return true;
	a++;
		}
        return false;
        }
    public void Agregaen(int ind, Atomo ing){
        this.add(ind, ing);
    }
    
    public Atomo remplaza(int b, Atomo remplaz){
        Atomo remplazo = this.remover(b);
        this.Agregaen(b, remplaz);
        return remplazo;
    }
    public Atomo remover(int b){
        return(Atomo) this.remove(b);
    }
    
    public Atomo getOp(){        
    return (Atomo)this.get(0);
    }
    public Atomo getAtom(int c){
        return(Atomo) this.get(c);
    }
    public Atomo quitar(int c){
        return(Atomo) this.remove(c);
    }
    
    public boolean iguales(Object ob){
        Lista newLista =(Lista)ob;
        if (size()!=newLista.size())
	return false;
	int index = 0;
	while (index < this.size()){
    if (!get(index).equals(newLista.get(index)))
        return false;
	}
        return true;
    }
        
        
        
        
        
        
        
        
}
